package com.jt.www.enums.endorse;

/**
 * 证件类型
 */

public enum CertificateTypeForCaseEnum {
    ID_CARD("身份证", 1, "cardType_0"),
    PASSPORT("护照", 2, "cardType_1"),
    STUDENT_CARD("学生证", 3, "cardType_13"),
    ACCOUNT("户口本", 4, "cardType_3"),
    OTHER("其他", 5, "cardType_11"),
    OTHER_2("其它", 5, "cardType_11"),
    OFFICERS_CARD("军官证", 6, "cardType_2"),
    OFFICERS_CARD_2("军人证", 6, "cardType_2"),
    BIRTH_CARD("出生证", 7, "cardType_4"),
    SOLDIERS("士兵证", 8, "cardType_5"),
    TEMPORARY_ID_CARD("士兵证", 9, "cardType_6"),
    TAIWAN_CARD("台湾居民来往大陆通行证", 10, "cardType_7"),
    HONG_KONG_MACAO_CARD("台湾居民来往大陆通行证", 11, "cardType_8"),
    DRIVING_LICENCE("驾驶执照", 12, "cardType_9"),
    RETURN_CARD("返乡证", 13, "cardType_10");


    private String msg;
    private byte eduCode;
    private String caseCode;

    CertificateTypeForCaseEnum(String msg, int eduCode, String caseCode) {
        this.msg = msg;
        this.eduCode = (byte) eduCode;
        this.caseCode = caseCode;
    }

    public static String getCaseCodeByEduCode(byte eduCode) {
        for (CertificateTypeForCaseEnum typeEnum : CertificateTypeForCaseEnum.values()) {
            if (typeEnum.eduCode == (eduCode)) {
                return typeEnum.getCaseCode();
            }
        }
        return "";
    }

    public static String getCaseCodeByMsg(String msg) {
        for (CertificateTypeForCaseEnum typeEnum : CertificateTypeForCaseEnum.values()) {
            if (typeEnum.msg.equals(msg)) {
                return typeEnum.getCaseCode();
            }
        }
        return "";
    }

    public static String getMsgCodeByCaseCode(String caseCode) {
        for (CertificateTypeForCaseEnum typeEnum : CertificateTypeForCaseEnum.values()) {
            if (typeEnum.caseCode.equals(caseCode)) {
                return typeEnum.getMsg();
            }
        }
        return "";
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public byte getEduCode() {
        return eduCode;
    }

    public void setEduCode(byte eduCode) {
        this.eduCode = eduCode;
    }

    public String getCaseCode() {
        return caseCode;
    }

    public void setCaseCode(String caseCode) {
        this.caseCode = caseCode;
    }
}
